#4 open
Philipp Pirozhkov

Setup assertion

Reported by Philipp Pirozhkov | November 28th, 2008 @ 11:16 AM

Setup is a block intended to be run before each should block to initialize the data to be tested so that different should statements doesn't clash


Behave.context('List') do
  setup do
    list = [1,2,3,4]

  should('pop a first value') do
    list.pop() == 1

  should('return its length') do
    list.length() == 4

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Behave is a testing framework dedicated to test Reia language and libraries

== Usage

Behave.context('A User instance') do
setup do
user = User.find(~first)

should('return its full name') do
assert('John Doe' == user.full_name)
assert('John' == user.name)
assert('Doe' == user.surname)

should('return its email address') do
'JohnDoe@gmail.com' == user.email

context('with a profile') do
user.profile = Profile.find(~first)

should('return true calling .has_profile?') do
user.has_profile()

People watching this ticket

Tags

Pages